Before you can run this program, you first must have a '.plan' file. You must also change in the program, where it says 'username@machine', your own e-mail address.
As the program stands, the output is an exact duplicate of what a normal finger command would produce, however modification is possible if you want some other information output to the nosy user. Example:
printf("It is currently: ");
system("date"); /* send system date */
fflush(stdout); /* flush the output */
You would insert this in the area of the 'system ("cat plan")'. Just remember to flush the stdout after each command.
To get this program working, first enter it in using an editor. Then at the system prompt do:
mv .plan plan <return>
mknod .plan p <return>
cc spy.c -o spy <return>
To run it, just enter:
spy & <return>
This pushes it off as into the background daemon where it will quietly sit. Do NOT run spy & unless you have already checked to make sure it is not already running. Because 'spy &' keeps it in the background, it will stay running even when you log out and back in. So it's rare you will need to start it up again.